﻿@using KRM.Web.Controllers
@model List<HomeController.TaskSnapShot>

@foreach (var item in Model)
{
    var color = "black";
    if (item.WorkRate < 20)
    {
        color = item.Total == 0 ? "green" : "red";
    }
    else if (item.WorkRate >= 20 && item.WorkRate < 40)
    {
        color = "Orange";
    }
    else if (item.WorkRate >= 40 && item.WorkRate < 60)
    {
        color = "green";
    }
    else if (item.WorkRate >= 60 && item.WorkRate < 80)
    {
        color = "blue";
    }
    else
    {
        color = "Violet";
    }
    <div class="border-padding10" style="border-color: @color">
        <div class="row-fluid">
            <div class="span1" style="background: @color"></div>
            <div class="span3">
                <strong>@item.UserName</strong><br />
                @item.WorkRate %
            </div>
            <div class="span2">Assigned: @item.Total</div>
            <div class="span2">Completed: @item.Completed</div>
            <div class="span2">Created: @item.Created</div>
            <div class="span2">Re-Assigned: @item.ReAssigned</div>
        </div>
    </div>
}